<template>
	<view class="helpcentercenter">
		<!-- 顶部导航 -->
		<diyNavBar value='详情' :bottom="30"></diyNavBar>
		<view class="box">
			<view class="title">{{getData.title}}</view>
			<view class="text" v-html="getData.context"></view>
		</view>
		<!-- 加载 -->
		<loading-cover ref="loadingCover"></loading-cover>	
	</view>
</template>

<script>
	import loadingCover from '../../component/loading-cover/loading-cover.vue';
	import diyNavBar from '../../component/diy-nav/diy-navbar.vue';
	export default{
		components:{loadingCover,diyNavBar},
		data(){
			return {
				getData:{}
			}
		},
		onLoad(option) {
			this.$http.sendrequest('/news/NewsId',{id:option.id},{
				tokenJudge:true
			}).then(res=>{
				if(res.code == 1){
					this.getData = res.data;
					this.getData.context = this.$util.SplicingImgSrc(this.getData.context)
					this.$forceUpdate();
					if(res.data.count == 0) {
						this.$http.sendrequest('/news/AddNewsjl',{news_id:option.id},{
							tokenJudge:true
						}).then(res=>{})
					}
					this.$refs.loadingCover.hide();
				}else uni.showToast({title:res.msg,icon:'none'})
			})
		},
		onShow(){
			
		}
	}
</script>

<style lang="scss" scoped>
	.helpcentercenter{
		min-height:100vh;
		background: $uni-content-background-color;
		box-sizing: border-box;
		.box{
			border-radius: 10rpx;
			padding: 30rpx;
			box-sizing: border-box;
			margin:0 30rpx;
			background: #FFFFFF;
			.title{
				font-size: 34rpx;
				font-weight: bold;
				margin-bottom: 30rpx;
			}
			.text{
				font-size: 28rpx;
				line-height: 1.5;
			}
		}
	}
</style>
